<%@ page import="com.bjfu.gmms.model.Mentor" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<head>
    <title>导师管理系统</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f9f9f9;
            margin: 0;
            padding: 0;
            height: 100vh; /* 使页面高度占满全屏 */
        }
        .container {
            width: 100%;
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
            background-color: white;
            border-radius: 10px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }
        h1 {
            text-align: center;
            font-size: 2.5em;
            color: #007bff;
            margin-bottom: 20px;
        }
        .link-list {
            display: flex;
            flex-direction: column;
            gap: 20px;
            margin-top: 30px;
        }
        .link-list a {
            display: block;
            padding: 15px;
            font-size: 18px;
            color: #fff;
            background-color: #007bff;
            border-radius: 5px;
            text-decoration: none;
            transition: background-color 0.3s, transform 0.3s;
        }
        .link-list a:hover {
            background-color: #0056b3;
            transform: scale(1.05);
        }
        .footer {
            text-align: center;
            margin-top: 40px;
            font-size: 14px;
            color: #777;
        }
    </style>
</head>
<body>
<div class="container">
    <h1>
        欢迎
        <%
            // 从 Session 中获取 Mentor 对象
            Mentor mentor = (Mentor) session.getAttribute("mentor");
            if (mentor != null) {
                out.print(mentor.getMentorName() + " 导师");
            } else {
                out.print("导师"); // 如果未获取到 Mentor 对象，显示默认值
            }
        %>
    </h1>
    <div class="link-list">
        <!-- WEB-INF文件下不能直接访问，需要通过servlet来跳转 -->
        <a href = "mentor_view/mentor_info.jsp">个人信息维护</a>
        <a href = "">登录账号修改</a>
        <%-- 获取剩余的招生名额 --%>
        <%
            int lastQuota = (Integer) request.getAttribute("lastQuota");
        %>

        <%-- 如果剩余招生名额大于0，显示链接，否则显示文本提示 --%>
        <% if (lastQuota > 0) { %>
        <a href="mentor_view/mentorSystem.jsp">志愿选择</a>
        <% } else { %>
        <a href="">您已招满学生</a>
        <% } %>
        <a href="mentor_view/resultSystem.jsp">招生结果查询</a>

    </div>
    <div class="footer">
        <p>版权所有 &copy; 2024 志愿管理系统</p>
    </div>
</div>
</body>
</html>

